Web servers often provide complicated services to the consumers or “visitors” to the web sites that they host. Some “visitors” are web browser programs being executed by client computers or web-enabled devices such as smartphones. In this situations, a human usually is operating the web browser, and the service is something the human user needs, such as news, social networking, information searching, bank account management, etc.
In other cases, the “visitors” of the hosted web service are other programs needing the functionality provided by the hosted service, such as calculation of mortgage payments, checking inventory of available products, obtaining available flight information, etc. From the web server's perspective, it is often indistinguishable what type of remote “user” is accessing the hosted service—human or machine.
In early generations of web-based services, a series of “screens” or pages would be provided from the web server to the remote user according to the input provided by the remote user, and based upon the logic of the hosted service. These logical processes were often designed according to state machine logic, in which the web server tracked the “state” of the current session with the user in order to assist in determined what the next state of the service should be for that remote user. The web server was responsible for “remembering” each client and their session states and statuses.
However, in the evolution of web-based services in which several servers, not just one, may contribute to the overall hosted service, this type of centralized state machine logic on the web server because inefficient, difficult to design, and difficult to debug. For example, commonly, a user may use a web browser to access a news web page which has text and picture (hosted by the main news web server), advertisements (hosted by separate ad servers), and videos (hosted by still separate video servers). The web page becomes a point of integration of information from all of these web servers, but forcing one web server to logically and functionally integrate all of the separate state machines for all of these source providers is problematic.
“Stateless” web server architectures have been developed to address this shift in web-based service hosting. A widely-adopted stateless web server architecture is Representational State Transfer (REST), which is reported to have been proposed in 2000 by Roy Fielding at the University of California, Irvine. In stateless web server architectures, the current state of a client's session is recorded by sending a trackable file, such as a cookie file, to the remote client device, where it is stored and then, later, returned to the web server with the next request. In classic state machine design, this means that the state machine executed by the web server is indexed by a state variable stored by the remote client. This architecture goes further to enable the different state machines on different servers which are contributing content or functionality to a client's session to use the state variable supplied by or from the client, without having to pass the state variable through a central or integrating web server.